package com.zhanghu.backendZray.annotation;

import com.zhanghu.backendZray.serializer.JacksonDataDesensitized;
import com.zhanghu.backendZray.strategy.DesensitizedStrategy;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 自定义注解，用于对敏感字段进行脱敏处理
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@JacksonAnnotationsInside
@JsonSerialize(using = JacksonDataDesensitized.class)
public @interface JsonSensitive {
    DesensitizedStrategy strategy();
}